Skip to main content

安装 APO-server

Last updated on

APO 分为两部分:

  • APO-server: APO 服务侧组件
  • APO-one-agent: APO 用户侧组件,用于采集Kubernetes集群或者虚机环境下被监控业务以及集群、主机信息。

本文档包含使用 Helm Chart 在 Kubernetes 集群上安装和运行 APO-server 的说明。

注意: 不建议用本文档的安装方式将 APO-server 与 APO-one-agnet 安装在同一 Kubernetes 集群中,会产生不必要的资源浪费;如果想要将 APO-server 与 APO-one-agent 部署在同一 Kubernetes 集群中,请参考快速开始文档

准备工作

  1. 要使用 Helm 安装 APO,请确保已完成以下操作:
  1. 网络防火墙配置: 参照《附录1:网络端口列表》说明开放端口

设置 APO Helm 仓库

要设置 APO Helm 存储库,以便在计算机上下载正确的 APO Helm charts,请完成以下步骤: 使用下方命令添加 apo Helm 仓库

helm repo add apo https://apo-charts.oss-cn-hangzhou.aliyuncs.com
helm repo update apo

配置 APO 组件

创建文件apo-values.yaml,并根据您的需求进行定义,并在部署阶段挂载配置。

# APO-server 配置
# 持久化配置,推荐打开,默认为false
# 如果为持久化配置则需要根据PVC为 clickhouse 与 victoria-metrics 创建PV
altinity-clickhouse-operator:
clickhouse:
persistence:
enabled: true
victoria-metrics-single:
server:
persistentVolume:
enabled: true

部署 APO Helm charts

运行以下命令,在指定命名空间中部署 APO 。

helm install apo apo/apo -n apo --create-namespace \
-f apo-values.yaml

验证

见到类似输出既代表安装成功

NAME: apo
LAST DEPLOYED: Fri Aug 9 15:48:42 2024
NAMESPACE: apo
STATUS: deployed
REVISION: 1
NOTES:
==================================================
___ ___ ___
/\ \ /\ \ /\ \
/::\ \ /::\ \ /::\ \
/:/\:\ \ /:/\:\ \ /:/\:\ \
/::\~\:\ \ /::\~\:\ \ /:/ \:\ \
/:/\:\ \:\__\ /:/\:\ \:\__\ /:/__/ \:\__\
\/__\:\/:/ / \/__\:\/:/ / \:\ \ /:/ /
\::/ / \::/ / \:\ /:/ /
/:/ / \/__/ \:\/:/ /
/:/ / \::/ /
\/__/ \/__/

Official Website: https://apo.kindlingx.com/
APO Frontend: http://<NodeIP>:31364
Jaeger: http://<NodeIP>:30686
Grafana: http://<NodeIP>:31364/#/system-dashboard
==================================================

输入下方命令检查pod是否启动成功

kubectl get po -n apo

# 您应该看到类似于以下内容的输出
NAMESPACE NAME READY STATUS RESTARTS AGE
apo apo-alertmanager-8485478bcb-t4br8 1/1 Running 0 5m
apo apo-altinity-clickhouse-operator-56668d96b6-h5jk2 2/2 Running 0 5m
apo apo-backend-dd6d5888-9x9l7 2/2 Running 0 5m
apo apo-collector-74b4887fc-4779p 2/2 Running 0 5m
apo apo-front-6dc47f4567-4d9qw 1/1 Running 0 5m
apo apo-grafana-6cdf857d78-drzb5 1/1 Running 0 5m
apo apo-jaeger-collector-659cc68b85-4tn2r 3/3 Running 0 5m
apo apo-otel-collector-75f7799579-qff54 1/1 Running 0 5m
apo apo-victoria-metrics-alert-server-9859d5f9f-fppgl 1/1 Running 0 5m
apo apo-victoria-metrics-single-server-0 1/1 Running 0 5m
apo chi-apo-clickhouse-0-0-0 1/1 Running 0 5m

访问 APO

您可以通过以下方式访问 APO,其中 NodeIP 为集群中任意一个节点的 IP 地址。

  • APO 向导式可观测性平台地址:http://<NodeIP>:31364

apo-home-page

  • Jaeger UI 地址:http://<NodeIP>:30686

jaeger-ui

  • Grafana 地址:http://<NodeIP>:31364/#/system-dashboard

apo-grafana

下一步:监控服务器和应用

请参阅文档安装 APO-one-agent 以监控服务器和应用:

更新与卸载

更新 APO Helm charts 配置

如果您的 APO 配置有更新,则在更新完apo-values.yaml文件后使用下方命令进行更新

helm upgrade apo apo/apo -n apo \
-f apo-values.yaml

卸载 APO Helm charts

kubectl delete clickhouseinstallation apo -napo
helm uninstall apo -n apo
kubectl delete ns apo

更多配置

本文档提供的为 APO 部署的基础配置,如果您要进行更多配置更改,请从 APO Helm Charts 库中下载values.yaml文件:

helm show values apo/apo > values.yaml

附录

附录1 网络端口列表

  • APO-server 需要将以下端口暴露给桌面浏览器用于访问,均可通过部署配置更改:
组件名开放端口说明
apo-front31364APO 向导式观测平台前端
  • APO-server 需要将以下端口暴露给 APO-one-agent 节点用于收集数据,均可通过部署配置更改:
组件名开放端口说明
apo-collector30044用于接收链路回溯采样数据
apo-otel-collector-gateway30317用于接收可观测性数据,OTLP gRPC 协议
apo-otel-collector-gateway30319用于接收 K8s 集群数据,OTLP gRPC 协议
apo-backend31363用于提供查询 API 服务